﻿@model Kojarskiy.Models.News

@{
    ViewBag.Title = "Добавление новости";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@Html.ActionLink("Администрирование", "Index", "Admin") | @Html.ActionLink("Новости", "Index", "News") | @ViewBag.Title
<div style="clear: both;"></div>

<fieldset>
    <legend>@ViewBag.Title</legend>
@using (Html.BeginForm("Create", "News", FormMethod.Post, new { enctype = "multipart/form-data", role = "form" }))
{
        <div class="bg-danger">@Html.ValidationSummary(true)</div>
        <div class="form-group">
            <label>Заголовок новости</label>
            @Html.TextBox("Name", "", new { @class = "form-control" })
        </div>

        <div class="form-group">
            <label>Новость</label>
            @Html.TextArea("Content", "", new { @class = "form-control multi-line" })
            <div class="bg-danger">@Html.ValidationMessageFor(model => model.Content)</div>
        </div>

        <h4>Мета-теги</h4>
        <hr/>
    
        <div class="form-group">
            <label>Title новости</label>
            @Html.TextBox("Title", "", new { @class = "form-control" })
            <div class="bg-danger">@Html.ValidationMessageFor(model => model.Title)</div>
        </div>
    
        <div class="form-group">
            <label>Description новости</label>
            @Html.TextBox("Description", "", new { @class = "form-control" })
            <div class="bg-danger">@Html.ValidationMessageFor(model => model.Description)</div>
        </div>
    
        <div class="form-group">
            <label>Keywords новости</label>
            @Html.TextBox("Keywords", "", new { @class = "form-control" })
            <div class="bg-danger">@Html.ValidationMessageFor(model => model.Keywords)</div>
        </div>            
    
        <div class="form-actions">
            <button type="submit" class="btn btn-success">Создать</button>   
        </div>
}
</fieldset>

<script type="text/javascript">
    $(document).ready(function () {
        CKEDITOR.replace('Content', { filebrowserUploadUrl: '/ru/home/UploadImageFromEditor' });
    });
</script>

